package com.ruyi.afterdemo.action;


import com.ruyi.afterdemo.po.OContact;
import com.ruyi.afterdemo.service.StuService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * gitTest Demo
 */
@RestController
@RequestMapping("/culture")
public class CultureAction {

    @Resource
    private StuService stuService;

    @PostMapping("/test")
    public Map test(@RequestBody OContact OContact){
        Integer flag = stuService.save(OContact);
        Map<String,Object> map = new HashMap<>();
        if (flag > 0){
            map.put("flag","success");
        }else {
            map.put("flag","error");
        }
        return map;
    }

}
